
showColourOf trafficLight

green(trafficLight) {
    change(trafficLight: trafficLight, to: 'amber')
}
amber(trafficLight) {
    change(trafficLight: trafficLight, to: 'red')
}
red(trafficLight) {
    change(trafficLight: trafficLight, to: 'redamber')
}
redamber(trafficLight) {
    change(trafficLight: trafficLight, to: 'green')
    localMethod()
}
performChange trafficLight


def localMethod() {
    println "localMethod called"
}